using UnityEngine;
using System.Collections;

public class Instructions : MonoBehaviour {
	
	public string[] instructions;
	public float interval = 5;
	private float timer = 0;
	private int index = 0;
	
	void Update () 
	{
		timer += Time.deltaTime;
		
		if(timer > interval)
		{
			if(index < instructions.Length - 1)
			{
				index++;
				timer = 0;
			}
			else
			{
				Destroy(gameObject);
			}
		}
		
		GetComponent<TextMesh>().text = instructions[index];
	}
}
